import { AppRouteRecordRaw } from '@/router/types.ts';

export const HOME_PATH = '/dashboard/console';
export const LAYOUT = () => import('@/layout/index.vue');

// 根路由
export const RootRoute: AppRouteRecordRaw = {
  path: '/',
  name: 'root',
  redirect: HOME_PATH,
  component: LAYOUT,
  children: [],
};

// 登录路由
export const LoginRoute: AppRouteRecordRaw = {
  path: '/login',
  name: 'login',
  component: () => import('@/views/login/index.vue'),
  meta: {
    noAffix: true,
  },
};

// 404 路由
export const PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = {
  // 将匹配所有内容并将其放在 `$route.params.pathMatch` 下
  path: '/:pathMatch(.*)*',
  name: '404',
  component: () => import('@/views/exception/404/index.vue'),
  hidden: true,
};

// 个人中心路由
export const accountRoutes: AppRouteRecordRaw = {
  path: '/account',
  name: 'account',
  component: LAYOUT,
  meta: {
    title: '个人页',
    lang: {
      en: 'Account',
    },
  },
  hidden: true,
  children: [
    {
      path: '/settings',
      name: 'AccountSettings',
      component: () => import('@/views/account/settings/index.vue'),
      meta: {
        title: '个人设置',
        lang: {
          en: 'Account Settings'
        }
      },
      hidden: true,
    }
  ]
};

// 基础路由
export const basicRoutes = [LoginRoute, RootRoute, PAGE_NOT_FOUND_ROUTE];
